<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>结果分页界面</title>
    <link rel="stylesheet" type="text/css" href="${s.base}/lib/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/index.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/theme/theme.css"/>
</head>
<body>
<div class="wrap-container clearfix">
    <div class="column-content-detail">
        <form class="layui-form">
            <input type="hidden" name="applyId" value="${applyId}"/>
            <div class="search-cont clearfix" id="tool">
                <div class="search-details">
                    <div class="layui-form-item marb5">
                        <!--search开始-->
                        <div class="layui-inline">
                            <label class="layui-form-label">标题：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="title" placeholder="请输入标题" autocomplete="off"
                                       class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">分班学段：</label>
                            <div class="layui-input-inline">
                                <select name="divideType" id="divideType"></select>
                            </div>
                        </div>
                        <!--search结束-->
                        <div class="layui-inline marl8">
                            <button class="layui-btn layui-btn-normal" type="button" lay-submit=""
                                    lay-filter="seacherBtn">
                                搜索
                            </button>
                            <button class="layui-btn layui-btn-normal" type="reset">重置</button>
                        </div>
                    </div>
                </div>
            </div>
        </form>
        <div class="layui-form" id="table-list">
            <table id="entityList" lay-filter="entityList" class="cy-list-table"></table>
        </div>
    </div>
</div>
<!--操作-->
<script type="text/html" id="entityBar">
    <a class="layui-btn layui-btn-radius layui-btn-primary layui-btn-sm layui-smbtn-green" lay-event="look">查看分班结果</a>
    <button type="button" class="layui-btn layui-btn-radius layui-btn-primary layui-btn-sm layui-smbtn-red"
            lay-event="tj">统计分析
    </button>
</script>
<script src="${s.base}/lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/js/common.js" type="text/javascript" charset="utf-8"></script>
<script>
    var tableIns = null;
    var menuId = parent.getTabId();
    var applyId = '${applyId}';
    layui.use(['jquery', 'table', 'page', 'dialog'], function () {
        var $ = layui.jquery,
            page = layui.page,
            table = layui.table,
            dialog = layui.dialog;

        //获取分页数据
        page.initDict('divideType,divideStatus,resultStatus', function (dictData) {
            page.showDict($("#divideType"), page.aceeptDictContentList(dictData, 'divideType'), "全部");
            var url = "/divideclass/divideclass/page?result=1";
            var cols = [
//                {type: 'checkbox', fixed: 'left'},
                {type: 'numbers', title: '序号'},
                {field: 'title', title: '标题', align: 'center'},
                {
                    field: 'divideType', title: '分班学段', align: 'center', templet: function (d) {
                    return page.aceeptDictContentName(dictData, 'divideType', d.divideType);
                }
                },
                {
                    field: 'createTime', title: '创建时间', align: 'center', templet: function (d) {
                    return new Date(d.createTime).Format("yyyy-MM-dd");
                }
                },
                {
                    field: 'resultStatus', title: '状态', align: 'center', templet: function (d) {
                    if (d.resultStatus === "0") {
                        return '<span style="color: red">' + page.aceeptDictContentName(dictData, 'resultStatus', d.resultStatus) + '</span>';
                    } else if (d.resultStatus === "1") {
                        return '<span style="color: grey">' + page.aceeptDictContentName(dictData, 'resultStatus', d.resultStatus) + '</span>';
                    }
                }
                },
                {title: '操作', width: 220, templet: '#entityBar', align: "center"}
            ];
            tableIns = page.initDate(cols, url);
        });
        table.on('tool(entityList)', function (obj) {
            var layEvent = obj.event,
                data = obj.data;
            if (layEvent === 'look') {
                page.edit("divideResultDetail", '/divideclass/divideclass/getDetailList?applyId=' + applyId + '&id=' + data.id + '&parentMenuId=' + parent.getTabId(), '编辑');
            }
            if (layEvent === 'tj') {
                page.edit("divideResultTj", '/divideclass/divideclass/getTj?applyId=' + applyId + '&id=' + data.id + '&parentMenuId=' + parent.getTabId(), '统计分析');
            }
        });
    });
</script>
</body>
</html>